﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace OpenST.Tiles
{
    class FlipTile : BaseTile
    {
        public FlipTile(ContentManager content)
            : base(content)
        {
            Sprite = content.Load<Texture2D>("Tiles/TileF");
            GetsSaved = true;
        }

        public override void Process(Bug bug)
        {
            // Normal tile just plays the audio
            bug.PlaySound(NoteNumber);

            // Turn it right...
            switch (bug.CurrentDirection)
            {
                case Bug.Direction.Right:
                    bug.CurrentDirection = Bug.Direction.Left;
                    break;
                case Bug.Direction.Left:
                    bug.CurrentDirection = Bug.Direction.Right;
                    break;
                case Bug.Direction.Down:
                    bug.CurrentDirection = Bug.Direction.Up;
                    break;
                case Bug.Direction.Up:
                    bug.CurrentDirection = Bug.Direction.Down;
                    break;
            }

            base.Process(bug);
        }
    }
}
